package guda.sqladmin.web.form;

import guda.sqladmin.dao.domain.ProjectTableDO;
import org.hibernate.validator.constraints.NotEmpty;

import javax.validation.constraints.NotNull;

public class ProjectTableForm {

    @NotNull
    private Long projectId;

    @NotEmpty(message = "{不能为空}")
    private String tableDesc;

    @NotEmpty(message = "{不能为空}")
    private String tableName;

    public String getTableDesc() {
        return tableDesc;
    }

    public void setTableDesc(String tableDesc) {
        this.tableDesc = tableDesc;
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    public ProjectTableDO toDO() {
        ProjectTableDO projectTableDO = new ProjectTableDO();
        projectTableDO.setTableDesc(this.tableDesc);
        projectTableDO.setTableName(this.tableName);
        projectTableDO.setProjectId(this.projectId);
        return projectTableDO;
    }

}
